import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'isolate_test_controller.dart';

class IsolateTestPage extends StatelessWidget {
  IsolateTestPage({Key? key}) : super(key: key);
  final controller = Get.put<IsolateTestController>(IsolateTestController());
  final state = Get.find<IsolateTestController>().state;
  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(title: const Text('Isolate线程测试')),
      body: Container(
        child: Column(
          children: [
            ElevatedButton(onPressed: ()=> controller.startIsolate1(), child: Text("开启线程1")),
            ElevatedButton(onPressed: ()=> controller.startIsolate2(), child: Text("开启线程2"))
          ],
        ),
      ),
    );
  }
}
